package com.matrix.user.converter;

import com.matrix.api.user.vo.UserInfoVO;
import com.matrix.api.user.vo.UserLoginInfoVO;
import com.matrix.user.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author 有点甜
 * @since 2025/8/5
 */
@Mapper
public interface UserConverter {

    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);

    UserInfoVO toUserInfoVO(User user);

    @Mapping(source = "uid", target = "userId")
    @Mapping(source = "phone", target = "account")
    UserLoginInfoVO toUserLoginInfoVO(User user);

    List<UserInfoVO> toUserInfoVOList(List<User> users);
}
